From a5d829862e9e9e93d2126b23dffa515e0c95e7c8 Mon Sep 17 00:00:00 2001 From: Lucas Kolstad Date: Wed, 30 Aug 2017 17:59:23 -0700 Subject: [PATCH] Replace plugins_dylib_path with host_deps_output. The plugins_dylib_path field on Compilation is removed because it is identical to host_deps_output, it is only used in one easily replaced location, and because host_deps_output is a more general name that includes its new usage location in cargo_test.rs as well while better matching the corresponding deps_output field. Also de-indents erroneously indented lines in a test case. --- src/cargo/ops/cargo_rustc/compilation.rs | 7 +------ src/cargo/ops/cargo_rustc/context.rs | 1 - tests/test.rs | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/compilation.rs b/src/cargo/ops/cargo_rustc/compilation.rs index 2f5c48553..c853290c7 100644 --- a/src/cargo/ops/cargo_rustc/compilation.rs +++ b/src/cargo/ops/cargo_rustc/compilation.rs @@ -35,10 +35,6 @@ pub struct Compilation<'cfg> { /// Output directory for the rust host dependencies. pub host_deps_output: PathBuf, - /// Library search path for compiler plugins and build scripts - /// which have dynamic dependencies. - pub plugins_dylib_path: PathBuf, - /// The path to rustc's own libstd pub host_dylib_path: Option, @@ -69,7 +65,6 @@ impl<'cfg> Compilation<'cfg> { root_output: PathBuf::from("/"), deps_output: PathBuf::from("/"), host_deps_output: PathBuf::from("/"), - plugins_dylib_path: PathBuf::from("/"), host_dylib_path: None, target_dylib_path: None, tests: Vec::new(), @@ -129,7 +124,7 @@ impl<'cfg> Compilation<'cfg> { -> CargoResult { let mut search_path = if is_host { - let mut search_path = vec![self.plugins_dylib_path.clone()]; + let mut search_path = vec![self.host_deps_output.clone()]; search_path.extend(self.host_dylib_path.clone()); search_path } else { diff --git a/src/cargo/ops/cargo_rustc/context.rs b/src/cargo/ops/cargo_rustc/context.rs index 0d34df739..906a5155a 100755 --- a/src/cargo/ops/cargo_rustc/context.rs +++ b/src/cargo/ops/cargo_rustc/context.rs @@ -175,7 +175,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> { None => {} } - self.compilation.plugins_dylib_path = self.host.deps().to_path_buf(); self.compilation.host_deps_output = self.host.deps().to_path_buf(); let layout = self.target.as_ref().unwrap_or(&self.host); diff --git a/tests/test.rs b/tests/test.rs index 40642db91..310ba9768 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -2828,8 +2828,8 @@ fn find_dependency_of_proc_macro_dependency_with_target() { "".parse().unwrap() } "#); - Package::new("dep_of_proc_macro_dep", "0.1.0").publish(); - workspace.build(); + Package::new("dep_of_proc_macro_dep", "0.1.0").publish(); + workspace.build(); assert_that(workspace.cargo("test").arg("--all").arg("--target").arg(rustc_host()), execs().with_status(0)); } -- 2.30.2